package com.sfc.spiderweb.eunm;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

public enum AmazonViolationDataTypeEnum {


    BRAND_PROTECTION("brand-protection", "涉嫌侵犯知识产权"), INTEL("intel", "收到的知识产权投诉"), RESTRICTED("restricted", "受限商品");


    AmazonViolationDataTypeEnum(String flg, String value) {
        this.value = value;
        this.flg = flg;
    }


    @Getter
    private String value;

    @Getter
    private String flg;

    private List<String> getflgs() {
        List<String> flgs = new ArrayList<>();
        flgs.add(BRAND_PROTECTION.getFlg());
        flgs.add(INTEL.getFlg());
        flgs.add(RESTRICTED.getFlg());
        return flgs;
    }

    public static String getEnumValue(String flg) {
        switch (flg) {
            case "brand-protection":
                return BRAND_PROTECTION.getValue();
            case "intel":
                return INTEL.getValue();
            case "restricted":
                return RESTRICTED.getValue();
            default:
                return "";
        }
    }

    public static String getEnumFlg(String value) {
        switch (value) {
            case "涉嫌侵犯知识产权":
                return BRAND_PROTECTION.getFlg();
            case "收到的知识产权投诉":
                return INTEL.getFlg();
            case "受限商品":
                return RESTRICTED.getFlg();
            default:
                return "";
        }
    }
}
